package sarahstools.gui;

import java.awt.BorderLayout;
import java.awt.TextArea;
import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

class Hauptfenster extends JFrame{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	Hauptfenster()
	{
		setVisible(true);
		setTitle("Sarah's Tools");
		setLocation(100,50);
		setSize(800,600);
		setResizable(false);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
	}
	
	@Override
	public void setTitle(String title) {

		title = title + " - rvp!";
		
		super.setTitle(title);
	}
	
}

public class GUI{
	
	public void zeigeHauptfenster() throws IOException
	{
		Hauptfenster Fenster = new Hauptfenster(); // Fenster erzeugen
	 
		Fenster.setLayout(new BorderLayout());
		
		BufferedImage bilddatei = ImageIO.read(getClass().getResource("../../images/Sarah.jpg"));
		ImageIcon bild = new ImageIcon(bilddatei);
		JLabel rahmen = new JLabel(bild);
		
		JButton hoppa = new JButton("Weltenberechnung");
		TextArea notiz = new TextArea("Notizen hier");
		
		hoppa.setBounds(10,10,150,32);
		notiz.setBounds(10,120,200,200);
		rahmen.setBounds(0,0,bilddatei.getWidth(),bilddatei.getHeight());
		
		Fenster.add(hoppa);
		Fenster.add(notiz);
		Fenster.add(rahmen);
		
		Fenster.repaint();	
		
	}

}